if exists (select 1
            from  sysobjects
           where  id = object_id('bd_view_bc_sd')
            and   type = 'V')
   drop view bd_view_bc_sd
go

/*==============================================================*/
/* View: bd_view_bc_sd                                          */
/*==============================================================*/
create view bd_view_bc_sd as
SELECT bc.id AS bc_id, bc.bh, bc.mc, bc.fh, bc.kssj, bc.jssj, bc.gly_no, bc.is_delete, bc.shift_type, st.name shift_type_name, sd.bh AS sd_id, sd.lx, sd.sbsj, sd.xbsj, sd.sbks, sd.xbjs, sd.cdsj, sd.ztsj, sd.bjcd, sd.bjzt, sd.qdqt, sd.sbws, sd.xbws, sd.alld, sd.allt, sd.types, sd.mach, sd.regserial, sd.repast_start_time, sd.repast_end_time, sd.repast_start_time2, sd.repast_end_time2, sd.is_enjoyment_subsidized, sd.middle_shift_start_time, sd.middle_shift_end_time, sd.night_shift_start_time, sd.night_shift_end_time, sd.is_flextime, sd.flextime_interval_begin, sd.flextime_interval_end
FROM dbo.zt_banci bc
INNER JOIN dbo.zt_shid sd ON sd.parent = bc.bh
INNER JOIN bd_sys_item st ON st.id = bc.shift_type AND st.type_id = 61
WHERE bc.is_delete = 0
go
